import TagModel from '../model/tagModel.js';
import Result from '../common/result.js';

const TagController = {
    // Get tag list by type
    async getList(req, res) {
        try {
            const { type } = req.query;
            if (!type) {
                return Result.badRequest(res, 'Type parameter is required');
            }
            const tags = await TagModel.getList(type);
            return Result.success(res, tags);
        } catch (error) {
            console.error('Get tags error:', error);
            return Result.error(res, 'Failed to get tags');
        }
    }
};

export default TagController; 